"use strict";
cc._RF.push(module, 'abbb7N5vGhKipTuwCmoVb5F', 'Global');
// scripts/Global.js

"use strict";

var t = require;
var e = module;
var o = exports;
Object.defineProperty(o, "__esModule", {
  value: !0
});
var n = t("Common"),
    i = t("SDK");
window.uc && uc.requestScreenOrientation({
  orientaiton: 2,
  success: function success() {},
  fail: function fail() {}
});
var s = new (function () {
  function t() {
    this._initialized = !1, this.guide = !1, this.noAd = !1, this.complateLevel = 0, this.yinsi = !1, this.settings = {
      music: 1,
      sound: 1,
      shock: 1
    }, this.shareVideo = !1, this.shareVideoCount = 0, this.unlimit = !1, this.hideWenqu = !1;
  }

  return t.prototype.init = function () {
    this.initUserInfo(), this._initialized = !0;
  }, t.prototype.complateYinsi = function () {
    this.yinsi = !0, i["default"].setLocalStorage("yinsi", "true");
  }, t.prototype.complateLv = function (t) {
    t > this.complateLevel && (this.complateLevel = t, i["default"].setLocalStorage("complate_level", t));
  }, t.prototype.initUserInfo = function () {
    "complate" == i["default"].getLocalStorage("guide") && (this.guide = !0), "true" == i["default"].getLocalStorage("yinsi") && (this.yinsi = !0), "true" == i["default"].getLocalStorage("no_ad") && (this.noAd = !0);
    var t = i["default"].getLocalStorage("complate_level");
    t && (this.complateLevel = parseInt(t));
    var e = i["default"].getLocalStorage("settings");
    e && (this.settings = JSON.parse(e)), 1 == this.settings.sound ? n["default"]._soundOpen = 1 : n["default"]._soundOpen = 0, 1 == this.settings.shock ? n["default"]._shockOpen = 1 : n["default"]._shockOpen = 0;
    var o = i["default"].getLocalStorage("userInfo");
    if (o) this.userInfo = JSON.parse(o);else {
      var s = {
        id: 0,
        nickName: "",
        gender: 0,
        avatarUrl: "",
        platform: i["default"].getPlatfrom()
      };
      this.userInfo = s, i["default"].setLocalStorage("userInfo", JSON.stringify(this.userInfo));
    }
  }, t.prototype.saveUser = function () {
    i["default"].setLocalStorage("userInfo", JSON.stringify(this.userInfo));
    var t = new cc.Event.EventCustom("GameEvent.UserInfoChange", !1);
    cc.director.dispatchEvent(t);
  }, t.prototype.complateGuide = function () {
    this.guide = !0, i["default"].setLocalStorage("guide", "complate");
  }, t;
}())();
o["default"] = s, "undefined" != typeof window && (window.Global = s);

cc._RF.pop();